<?php
namespace Common\Model;
use Think\Model;
class CallRecordModel extends Model {
    /**
     * model的中文名称
     */
    public $modelName = '呼叫记录';

    /**
     * model的icon
     */
    public $modelIcon = 'icon-exchange';
    
    protected $_auto = [
        ["create_time", "strtotime", 3, "function"],
        ["update_time", "strtotime", 3, "function"],
        ["create_time", "time", 1, "function"],
        ["update_time", "time", 2, "function"],
    ];
    protected $_validate = [
        ["id", "require", "ID必须填写!"],
        ["calling_user_id", "require", "主叫用户必须填写!"],
        ["calling_user_phone", "require", "主叫电话必须填写!"],
        ["called_user_id", "require", "被叫用户必须填写!"],
        ["called_user_phone", "require", "被叫电话必须填写!"],
        ["create_time", "require", "呼叫时间必须填写!"],
        ["update_time", "require", "更新时间必须填写!"],
    ];
    public $excel = false;
    public $fieldMap = [
        "id"=>[
            "type"=>"input",
            "name"=>"ID",
            "list"=>true,
            "search"=>true,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "calling_user_id"=>[
            "type"=>"foreign",
            "name"=>"主叫用户",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"user,id,name,input",
            "list_specify"=>"",
        ],
        "calling_user_phone"=>[
            "type"=>"input",
            "name"=>"主叫电话",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "called_user_id"=>[
            "type"=>"foreign",
            "name"=>"被叫用户",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"user,id,name,input",
            "list_specify"=>"",
        ],
        "called_user_phone"=>[
            "type"=>"input",
            "name"=>"被叫电话",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "create_time"=>[
            "type"=>"datetime",
            "name"=>"呼叫时间",
            "list"=>true,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "update_time"=>[
            "type"=>"datetime",
            "name"=>"更新时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
    ];
}
